package com.zhoutianyu.learnspringboot.controller;

import com.zhoutianyu.learnspringboot.config.SystemInit2Service;
import com.zhoutianyu.learnspringboot.config.SystemInit4Service;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class UserController {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserController.class);

    @Autowired
    SystemInit2Service systemInit2Service;
    @Autowired
    SystemInit4Service systemInit4Service;

    @GetMapping(value = "/get")
    public String function(String paramType) {
        LOGGER.info("paramType is {}", paramType);
        LOGGER.info("——————————————1");
        systemInit2Service.init2();
        LOGGER.info("——————————————1");
        LOGGER.info("——————————————2");
        systemInit4Service.init4();
        LOGGER.info("——————————————2");
        return paramType;
    }
}